<%@page import="com.liferay.portal.kernel.util.ListUtil"%>
<%@page
	import="com.bkav.portal.portlet.product.service.ProductLocalServiceUtil"%>
<%@page import="com.bkav.portal.portlet.product.model.Product"%>
<%@page
	import="com.bkav.portal.portlet.product.service.ProductCategoryLocalServiceUtil"%>
<%@page import="com.bkav.portal.portlet.product.model.ProductCategory"%>
<%@page import="java.util.List"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://alloy.liferay.com/tld/aui" prefix="aui"%>
<%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui"%>
<%@ taglib uri="http://liferay.com/tld/util" prefix="liferay-util"%>

<%@ page language="java" contentType="text/html; charset=UTF-8"%>

<%@include file="/html/product/init.jsp"%>
<%
	List<ProductCategory> productCategoryList = ProductCategoryLocalServiceUtil
			.findAll();
	long categoryId = ParamUtil.getLong(request, "categoryId");
	int productIndex = 0;
	List<Product> productListCategoryId = ProductLocalServiceUtil
			.findByCategory(categoryId);
	List<Product> productList = ProductLocalServiceUtil.findAll();
%>
<liferay-ui:search-container emptyResultsMessage="no-entry-found">
		<liferay-ui:search-container-results
			results="<%=ListUtil.subList(productList,
							searchContainer.getStart(),
							searchContainer.getEnd())%>"
			total="<%=productList.size()%>" />
		<liferay-ui:search-container-row className="Product"
			keyProperty="productId" modelVar="Product">
			<%
				productIndex++;
			%>
			<liferay-ui:search-container-column-text name="#"
				value="<%=String.valueOf(productIndex)%>" />
			<liferay-ui:search-container-column-text name="Sản phẩm"
				value="<%=Product.getProductName()%>"/>
		</liferay-ui:search-container-row>
        <liferay-ui:search-iterator paginate="<%=false%>" />
</liferay-ui:search-container>

